# hard drives
tgtdrive="undefined"
for drv in `ls -1 /sys/block | grep "sd\|hd\|vd\|cciss"`; do
    if (grep -q 0 /sys/block/${drv}/removable); then
        d=`echo ${drv} | sed -e 's/!/\//'`
        tgtdrive="${d}"
        break
    fi
done

# bootloader
echo "bootloader --location=mbr --driveorder=${tgtdrive} --append=' biosdevname=0 crashkernel=auto'" > /tmp/bootloader.ks

# partition
/usr/sbin/parted -s /dev/${tgtdrive} mklabel gpt
echo "partition /boot --fstype=ext4 --ondisk=${tgtdrive} --size=300 --asprimary" > /tmp/partition.ks
echo "partition / --fstype=ext4 --ondisk=${tgtdrive} --size=1 --grow --asprimary" >> /tmp/partition.ks
echo "partition swap --recommended --ondisk=${tgtdrive}" >> /tmp/partition.ks
